
<div class="row-fluid">
    <div class="span12">
        <div id="pagination" class="btn-group"><?= $pagination ?></div>
    </div>
</div>
<form action="<?= base_url() ?><?= get_segment(1) ?>/<?= get_segment(2) ?>/all" method="post" style="margin-bottom: 5px;" >
    <div><b><?= lang('label_sms_balance') ?>: </b><?= $msg ?></div>
    <div class="row-fluid">
        <div class="span12">
            <div  class="box corner-all">
                <div class="box-header grd-white corner-top"> <?= $this->lang->line('label_browser') ?> [<?= count($result) ?>/<?= $count ?>] </div>

                <div id='box-body'>
                    <table class="table table-hover">
                        <thead>
                            <tr>
                                <th><?= $this->lang->line('label_sender_user') ?></th>
                                <th><?= $this->lang->line('label_sms_type') ?></th>
                                <th><?= $this->lang->line('label_sms_total_numbers') ?></th>
                                <th><?= $this->lang->line('label_message') ?></th>
                                <th><?= $this->lang->line('label_sms_total_status') ?></th>
                                <th><?= $this->lang->line('label_created_date') ?></th>
                                <th><?= $this->lang->line('label_sms_start_date') ?></th>
                                <th><?= $this->lang->line('label_sms_end_date') ?></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?
                            foreach ($result as $value) {
                                $user_add = get_store_name_by_id($value->store_id);
                                ?>
                                <tr class="gradeA">
                                    <td><? if ($user_add) { ?>
                                            <a href='<?= base_url() . ADMIN_FOLDER ?>/stores/view/<?= $value->store_id ?>'><?= $user_add ?></a>
                                        <? } ?></td>
                                    <td><? echo $this->lang->line('label_sms_type_' . $value->type); ?></td>
                                    <td><?= get_message_sendto($value->id, true) ?></td>
                                    <td><?= $value->message ?></td>
                                    <td>
                                        <b><?= lang('label_sms_wait_send') ?>: </b><?= get_message_sendto($value->id, true, 'wait') ?><br />
                                        <b><?= lang('label_sms_success_send') ?>: </b><?= get_message_sendto($value->id, true, 'send') ?><br />
                                        <b><?= lang('label_sms_fail_send') ?>: </b><?= get_message_sendto($value->id, true, 'fail') ?><br />
                                    </td>
                                    <td><?= timespan($value->create_date, time()) ?></td>
                                    <td><?= timespan($value->start_date, time()) ?></td>
                                    <td><?= timespan($value->end_date, time()) ?></td>

                                </tr>
                            <? } ?>
                        </tbody>
                    </table>

                </div>

                <div class="footer_tool_box">
                </div>

            </div>
        </div>

    </div>

</form>



